Skip to content

Conversation

mkusaka
Copy link

@mkusaka mkusaka commented Nov 18, 2024

Description

Fixes an issue where Docker images with SHA256 hashes in their tags were being incorrectly validated, resulting in false "Missing image tag" errors. The fix modifies the tag parsing logic to properly handle tags that include SHA256 hashes by extracting only the version number portion for validation purposes.

For example, with an image like cimg/node:22.11.0@sha256:76aae59c6259672ab68819b8960de5ef571394681089eab2b576f85f080c73ba, the system now correctly extracts 22.11.0 as the tag for validation while preserving the full reference.

version: 2.1

jobs:
  build:
    docker:
      - image: cimg/node:22.11.0@sha256:76aae59c6259672ab68819b8960de5ef571394681089eab2b576f85f080c73ba
    steps:
      - checkout
      - run:
          name: Install Dependencies
          command: npm install
workflows:
  build:
    jobs:
      - build

image

Implementation details

  • Modified parseDockerImageValue in dockerImageParser.go to split tags at "@" and use only the version part for validation
  • Added test case in dockerImageParser_test.go to verify correct handling of tags with SHA256 hashes
  • Preserves the full image reference including SHA256 hash in FullPath field

Split Docker image tags at '@' to properly validate version numbers when SHA256 hash is present.
@pete-woods
Copy link
Contributor

Superseded by #340

@mkusaka mkusaka deleted the fix-docker-image-tag-parser branch September 30, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants